const koa = require('koa');
const Pug = require('koa-pug');
const pathlib = require('path');

let server = new koa();
server.listen(8080);

let pug = new Pug({
    viewPath: pathlib.resolve('./pug'),
    app: server,
})

server.use(async (ctx) => {
    let html = await ctx.render('1', {a: 12});
    console.log(html);
})